//
//  PersonalNewTopView.swift
//  AESOLAR_IOS
//
//  Created by Bin Tang on 2024/10/11.
//  Copyright © 2024 Mr.Wang. All rights reserved.
//

import UIKit

/**
 个人信息头部视图
 */
class PersonalNewTopView: UIView {
    
    var personalBgView: UIImageView? = nil
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupSubView()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupSubView() {
        self.backgroundColor = UIColor.white
        
        setupPersonalBgView()
    }
    
    func setupPersonalBgView() {
        let image = UIImage(named: "ic_personal_top_bg")
        let frame = self.bounds
//        print("w=\(String(describing: image?.size.width)); h=\(String(describing: image?.size.height))")
        // UIImageView().config
//            .image(#imageLiteral(resourceName: "ic_personal_top_bg"))
//        let imageView = UIImageView(frame: frame).config.imageName("ic_personal_top_bg").addTo(self).view
        let imageView = UIImageView(frame: frame).config.image(#imageLiteral(resourceName: "ic_personal_top_bg")).addTo(self).view
//        imageView.contentMode = .scaleAspectFit
//        imageView.image = image
//        self.addSubview(imageView)
        self.personalBgView = imageView
    }
    
    // ic_personal_top_bg
}
